<%inherit file="base.html"/>

<%block name="mainbody">

<p>${ _("Navigation would be show in header of site.") }</P>

<div>
  <select class="language-select">
    <option value="all">${ _("All") }</option>
    % for code in LANGUAGES:
    <option value="${ code }" ${ b2s(code == cur_locale, 'selected="selected"') }>${ LANGUAGES[code] }</option>
    % endfor
  </select>
</div>

<table class="table table-hover" id="entry-list">
  <thead>
    <tr>
      <th></th>
      <th>ID</th>
      <th>${ _("Name") }</th>
      <th>${ _("URL") }</th>
      <th>${ _("Position") }</th>
      <th>${ _("Language") }</th>
      <th>${ _("Type") }</th>
    </tr>
  </thead>
  <tbody>
    % for I in navs:
    <tr class="item" id="item${ I.id }">
      <td><input type="checkbox" name="checkbox" id="checkbox${ I.id }"></td>
      <td class="item-id">${ I.id }</td>
      <td>${ I.name }</td>
      <td>${ I.url }</td>
      <td class="position">${ I.position }</td>
      <td>${ I.language.name }</td>
      <td>${ I.type_str }</td>
    </tr>
    % endfor
  </tbody>
</table>

<div class="management">
  <div class="btn-group">
    <a class="btn"><input type="checkbox" name="checkbox_all"></a>
    <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
      <span class="caret"></span>
    </a>
    <ul class="dropdown-menu">
      <li><a href="" class="select-all">${ _("Select All") }</a></li>
      <li><a href="" class="unselect-all">${ _("Unselect All") }</a></li>
    </ul>
  </div>
  <a href="" role="button" class="btn action-edit support-one disabled"><i class="icon-pencil"></i> ${ _("Edit") }</a>
  <a href="" role="button" class="btn action-delete support-nonzero disabled"><i class="icon-trash"></i> ${ _("Delete") }</a>
  <a href="" role="button" class="btn action-plus support-nonzero disabled"><i class="icon-arrow-up"></i> ${ _("Plus") }</a>
  <a href="" role="button" class="btn action-minus support-nonzero disabled"><i class="icon-arrow-down"></i> ${ _("Minus") }</a>
  <a class="btn" href="${ reverse_url('admin:site:nav:add') }"><i class="icon-plus-sign"></i> ${ _("New") }</a>
</div>

<div id="delete-warning" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
    <h3 id="myModalLabel">${ _("Delete Confirm") }</h3>
  </div>
  <div class="modal-body">
    <p>${ _("Are you sure to delete these items ?") }</p>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">${ _("Close") }</button>
    <button class="btn btn-primary delete-confirm">${ _("Delete") }</button>
  </div>
</div>

<script type="text/javascript" src="${ theme_url('js/admin/site.js') }"></script>
<script type="text/javascript" src="${ theme_url('js/admin/site-nav.js') }"></script>
<script type="text/javascript">
  binding_checkbox();
  binding_language_select('/admin/site/nav?language=');

  binding_action_edit();
  binding_action_delete();
  binding_action_position_adjust('.action-plus', 1);
  binding_action_position_adjust('.action-minus', -1);
</script>


</%block>
